Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 2 - Control Manager Reference / Control Manager Functions
Handling Keyboard Focus /


GetKeyboardFocus

NEW WITH THE APPEARANCE MANAGER

Gets a handle to the control with the current keyboard focus for a specified window.

pascal OSErr GetKeyboardFocus (
                     WindowPtr inWindow,
                     ControlHandle* outControl);
inWindow
On input, a pointer to the window for which you wish to get keyboard focus.
outControl
On output, a pointer to a handle to the control that currently has keyboard focus. Produces nil if no control has focus.
function result
A result code; see "Result Codes". The result code errNoRootControl indicates that keyboard focus is unavailable because the window does not have an embedding hierarchy established.
DISCUSSION
The GetKeyboardFocus function returns the handle of the control with current keyboard focus within a specified window.

SEE ALSO
SetKeyboardFocus.

"Handling Keyboard Focus".

"Appearance Manager Gestalt Selector Constants".


Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998